package com.alks.function.mapper.pcfactoryquery;

import com.alks.entity.data.entity.PcSlipDetailPartBf;
import com.alks.entity.data.entity.PcSlipDetailPartBf2;
import com.alks.function.data.dto.finance.costcheck.PcPackDetailsReq;
import com.alks.function.data.dto.pcfactoryquery.PartBfInDto;
import com.alks.function.data.dto.pcfactoryquery.PartBfOutDto;
import com.alks.function.data.dto.pcfactoryquery.PartStockHeadDto;
import com.alks.function.data.request.factoryquery.PartBfInRequest;
import com.alks.function.data.request.factoryquery.PartBfOutRequest;
import com.alks.function.data.request.factoryquery.PartStockRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 耗品出入库明细 Mapper 接口
 * </p>
 *
 * @author ms
 * @since 2023-08-03
 */
public interface FT_QR_PcSlipDetailPartBfMapper extends BaseMapper<PcSlipDetailPartBf> {

    /*入库查询*/
    List<PartBfInDto> queryPartBfIn(@Param("request") PartBfInRequest request, @Param("companyId") String companyId, @Param("printFlag") int printFlag);

    /*出库查询*/
    List<PartBfOutDto> queryPartBfOut(PartBfOutRequest request);

    /*耗品库存*/
    List<PartStockHeadDto> queryPartBfStockHead(PartStockRequest request);

    List<PcSlipDetailPartBf2> getConsumableList(PcPackDetailsReq req);

    void optionConsumable(List<PcSlipDetailPartBf2> list, String choose);

    @Select("select * from PC_SLIP_DETAIL_PART_BF where slip_no = #{slipNo} and company_id = #{companyId}")
    List<PcSlipDetailPartBf2> getConsumableDetail(@Param("slipNo") String slipNo, @Param("companyId") String companyId);

    void saveConsumableDetail(List<PcSlipDetailPartBf2> list);

    BigDecimal getPcUnitPrice(PcSlipDetailPartBf2 detailPartBf2);

}
